<div class="content"><!-- Giua,Content Phần thân:  --> 
    <div class="content_Trai"><!-- Giua,Content,content_Trai Phần thân trai  -->
        <div class="content_Trai_Tren">
        </div>
        <div class="content_Trai_ABC"><!--Menu tim kiem theo chua cai-->
            <h2><?php echo $this->lang->line('chondeselect') ; ?></h2>
            <?php
				$arr=array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
			 	for ($i=0; $i<count($arr); $i++)
				  {
				   echo '<a href="'.base_url().'index.php/'.$language.'/Trangchu/TimSP_KT/'.$arr[$i].'">'.$arr[$i].'</a>';
				  }
			 ?> 
        </div>
        <div class="content_Trai_DanhMuc"><!--Menu tim kiem theo chua cai---> 
            <nobr> <span> </span> <span><?php echo $this->lang->line('danhmucq') ; ?></span></nobr>
                <ul> 
					<?php 
                          if(is_array($danhmuc)){
                               foreach ($danhmuc as $item){ 
							   		if($item['MaDM_Cha']==0){
                    ?>
                                   <li><span><a href="<?php echo base_url()?>index.php/<?php echo $language; ?>/Trangchu/SanPham/<?php echo $item['MaDM']; ?>/<?php if($language=='vi'){ echo $item['TenDanhMuc'];} else { echo $item['TenDanhMuc_EN'];} ?>"><?php if($language=='vi'){ echo $item['TenDanhMuc'];} else { echo $item['TenDanhMuc_EN'];} ?> (<?php echo $item['Dem']; ?>)</a></span>
                                        <ul>
                                    <?php	 foreach ($danhmuc as $item1){  ?>
                                            <?php  if($item['MaDM']==$item1['MaDM_Cha']  ){ ?> 
                                                <li><span><a href="<?php echo base_url()?>index.php/<?php echo $language; ?>/Trangchu/SanPham/<?php echo $item1['MaDM']; ?>/<?php if($language=='vi'){ echo $item1['TenDanhMuc'];} else { echo $item1['TenDanhMuc_EN'];} ?>"><?php if($language=='vi'){ echo $item1['TenDanhMuc'];} else { echo $item1['TenDanhMuc_EN'];} ?> (<?php echo $item1['Dem']; ?>)</a></span></li>
                                            <?php  	 }?>
                                    <?php  	 }?>
                                        </ul> 
                                   </li> 
                     <?php  		} 
                          	   } 
                    	   } 
					 ?> 
               </ul> 
        </div> 
        <div class="content_Trai_TimKiem"><!--Menu tim kiem theo chua cai--->
            <nobr><span></span><span><?php echo $this->lang->line('timkiemq') ; ?></span></nobr>
            <div class="TimKiem_Khung">
                <br />       <br />             
                     <?php
                       $attributes = array('id'=>'frmTK','name'=>'frmTK','method'=>'get');
                       echo form_open_multipart('trangchu/timkiem/',$attributes);                
                        if(isset($danhmucs)){
                                if(is_array($danhmucs)){
                                                                        $options=array();
                                                                                 
                                                                                if($language=='vi')
                                        $options[0]='Tất cả';
                                        else $options[0]='All';
                                                                               
                                    foreach ($danhmucs as $item){
                                        if($language=='vi')
                                        $options[$item['madm']]=$item['tendanhmuc'];
                                        else $options[$item['madm']]=$item['tendanhmuc_en'];
                                    }  
                                     echo form_dropdown('ma_dm', $options);                                }
                                }                
                    ?>        						
                    <br />      <br />  
                    <input  type="text" id="txtTen" name="key" placeholder="<?php echo $this->lang->line('nhaptenq') ; ?>" /><br /><br /> 
                    <nobr><samp> </samp><samp><input id="Tim" type="submit"   value="<?php echo $this->lang->line('timkiemq') ; ?>" /></samp><samp> </samp> </nobr>  
                </form>
            </div>
        </div>   
        <br />   <br /> 
        <div class="content_Trai_New"><!--Menu Sản Phẩm Mới--->
             <nobr> <span> </span> <span><?php echo $this->lang->line('sanphammoiq') ; ?></span></nobr>
             <?php if(is_array($SP_Top2)){
				 	 foreach ($SP_Top2 as $item){ 
			 ?>
             <div class="New_Khung">
                 <p><a class="TeuDe_New_SP" href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/TrangChu/ChiTiet/<?php echo $item['MaSP']; ?>"><?php echo $item['TenSanPham'] ?></a> </p>
 
                   <a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/TrangChu/ChiTiet/<?php echo $item['MaSP']; ?>"><img class="Hinh_New_SP" src="<?php echo base_url().$item['Hinh']?>" /></a>
 
                 <p class="Gia_New_SP"><?php echo DoiTien($language,$item['DonGia']); ?></p>
             </div>
             <?php  } }?> 
        </div>      
    </div><!-- Giua,Content,content_Trai Phần thân trai  -->    
    <div class="content_Phai"><!-- Giua,Content,content_Phai Phần thân phai  -->
        <div class="dangNhap"><!-- Giua,Content,dangNhap Phần thân phai  --> 
            <ul> 
            	<?php $TaiKhoan = $this->session->userdata("TaiKhoan"); ?>  
                	<?php if(!empty($TaiKhoan)){ ?>     
						<?php if($TaiKhoan['Quyen']==1){ ?> 
                        	<li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/DangXuat"><?php echo $this->lang->line('dangxuat'); ?></a>
                			</li><!--YES-->
							<li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/quanlysanpham/index"><?php echo $this->lang->line('quantri'); ?></a>
                			</li><!--YES-->
                            <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/TaiKhoan">
								<?php echo $this->lang->line('hoten') ; ?>
                                <?php echo "".$TaiKhoan['HoTen']."" ;?> </a>
                            </li><!--YES-->
                        <?php } ?>  
                        <?php if($TaiKhoan['Quyen']==2){ ?>  
                        	<li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/DangXuat"><?php echo $this->lang->line('dangxuat'); ?></a>
                			</li><!--YES--> 
                            <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/TaiKhoan">
								<?php echo $this->lang->line('hoten') ; ?>
                                <?php echo "".$TaiKhoan['HoTen']."" ;?> </a>
                            </li><!--YES-->
                        <?php } ?>   
                    <?php }else{ ?> 
                       	<li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/DangKy"><?php echo $this->lang->line('dangky') ; ?></a>
                        </li><!--YES-->
                        <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/DangNhap"><?php echo $this->lang->line('dangnhap') ; ?></a>
                		</li><!--YES-->
                    <?php } ?>         	
            </ul>
        </div>
        <div class="menu_Ngang"><!-- Giua,Content,menu_Ngang Phần thân phai  --> 
            <ul>
            	<li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/index"><?php echo $this->lang->line('trangchu') ; ?></a>
                </li><!--YES-->
                <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/SanPham/0/Sản Phẩm"><?php echo $this->lang->line('sanphamm') ; ?></a>
                	<ul> 
                    <?php 
                          if(is_array($danhmuc)){
                               foreach ($danhmuc as $item){ 
							   		if($item['MaDM_Cha']==0){
                    ?>
                                    <li><a href="<?php echo base_url()?>index.php/Trangchu/SanPham/<?php echo $item['MaDM']; ?>/<?php if($language=='vi'){ echo $item['TenDanhMuc'];} else { echo $item['TenDanhMuc_EN'];} ?>"><?php if($language=='vi'){ echo $item['TenDanhMuc'];} else { echo $item['TenDanhMuc_EN'];} ?></a> 
                                        <ul>
                                    <?php	 foreach ($danhmuc as $item1){  ?>
                                            <?php  if($item['MaDM']==$item1['MaDM_Cha']  ){ ?> 
                                                <li><a href="<?php echo base_url()?>index.php/Trangchu/SanPham/<?php echo $item1['MaDM']; ?>/<?php if($language=='vi'){ echo $item1['TenDanhMuc'];} else { echo $item1['TenDanhMuc_EN'];} ?>"><?php if($language=='vi'){ echo $item1['TenDanhMuc'];} else { echo $item1['TenDanhMuc_EN'];} ?></a> </li>
                                            <?php  	 }?>
                                    <?php  	 }?>
                                        </ul> 
                                    </li> 
                     <?php  		} 
                          	   } 
                    	   } 
					 ?>   
                    </ul>
                </li><!--YES-->
                <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/TinTuc"><?php echo $this->lang->line('tintuc') ; ?></a>
                </li><!--YES-->       
                <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/LienHe"><?php echo $this->lang->line('lienhe') ; ?></a>
                </li><!--YES-->
                <li><a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Trangchu/GioiThieu"><?php echo $this->lang->line('gioithieu') ; ?></a>
                </li><!--YES-->        
            </ul>
        </div>  